package com.my.study.springframework.bean.factory.support;

import com.my.study.springframework.bean.BeansException;
import com.my.study.springframework.core.io.Resource;
import com.my.study.springframework.core.io.ResourceLoader;

/**
 * @author: yidujun
 * @create: 2021/06/21 15:41
 */
public interface BeanDefinitionReader {

    /**
     * 获取bena注册
     * @return
     */
    BeanDefinitionRegistry getRegistry();

    /**
     * 获取资源加载器
     *
     * @return
     */
    ResourceLoader getResourceLoader();

    /**
     * 根据资源加载BeanDefinitions
     *
     * @param resource
     * @throws BeansException
     */
    void loadBeanDefinitions(Resource resource) throws BeansException;

    /**
     * 根据资源加载BeanDefinitions
     *
     * @param resources
     * @throws BeansException
     */
    void loadBeanDefinitions(Resource... resources) throws BeansException;

    /**
     * 根据资源路径加载BeanDefinitions
     *
     * @param location
     * @throws BeansException
     */
    void loadBeanDefinitions(String location) throws BeansException;

    /**
     * 加载资源
     * @param locations
     * @throws BeansException
     */
    void loadBeanDefinitions(String... locations) throws BeansException;
}
